/*
 * NodeImmutable.h
 *
 *  Created on: Apr 25, 2012
 *      Author: REZNIK
 */

#ifndef NODEIMMUTABLE_H_
#define NODEIMMUTABLE_H_

#include "NodeImpl.h"
#include "ListException.h"

namespace cs236703_spring2012_hw2{

class NodeImmutable : public NodeImpl
{
private:
	const int value;
public:
	NodeImmutable(int _value) : value(_value) {}
	virtual ~NodeImmutable(){}

	virtual void SetValue(int _value){ throw ImmutableModificationException(); }
	virtual int GetValue() const { return value; }
	virtual bool IsImmutable() const{ return true; }
};

};

#endif /* NODEIMMUTABLE_H_ */
